{extend name="layout:base" /}{block name="content"}
 <?php
$global=isSupperManagerForSession();
 ?>
 <style>
.table th{text-align:center;}
.tip{
position:absolute;
background:#9FC;
border-color:#F60;
z-index:9999;
filter:alpha(opacity=80);  
-moz-opacity:0.8;  
-khtml-opacity: 0.8;  
opacity: 0.8;  
}
.hidden-detail{
  display:none;
}
.mypointer{
width:95%;overflow:hidden;height:25px;line-height:25px;cursor: pointer;
}
</style>

<link rel="stylesheet" type="text/css" href="/static/admin/css/style.css" />
<script src="/static/mimi/js/confirm/js/jquery-1.9.1.js"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/static/mimi/css/animate.min.css" type="text/css" />
<link rel="stylesheet" href="/static/mimi/css/font-awesome.min.css" type="text/css" />
   
<section class="topBanners">
   <div class="icon"></div>
   <div class="topBannersNav">
   		<span data-url="/admin/agent/agentList" onclick="ContentLoadGo('/admin/agent/agentList')">代理商管理</span>
   </div>
</section>
   
<section style="margin-top:10px;margin-left:auto;margin-right:auto;">
      <select name="ser_key" id="ser_key" class="select" >
      <option value="uname" <?php if($request['ser_key']=="title"){echo 'selected';} ?>>电话</option>
        <option value="nickname" <?php if($request['ser_key']=="title"){echo 'selected';} ?>>昵称</option>
      </select>
      <input type="text" class="textbox" name="ser_val" id="ser_val" value="<?php echo $request['ser_val']; ?>" placeholder=""/>

      <input type="button" value="搜索" class="group_btn research" id="resource" page="1" />
      		<?php
	    if( ( in_array(30200,$ruleLists) || $global==1) )
		{
    	?>
      <input power="30200" type="button" onclick="addAccpoint();" value="添加" class="group_btn add fr" />
      	<?php
      	}
      	?>
      <br style="clear:both;width:0px;height:0px;">
</section>
 
<table class="table" style="margin-top:10px;">
<tr>
<th style="width:50px;">ID</th>
<th style="width:50px;">电话</th>
<th style="width:100px;">昵称</th>
<th style="width:100px;">编号</th>
<th style="width:100px;">余额</th>
<th style="width:100px;">状态</th>
<th style="width:100px;">操作</th>
</tr>

<?php 
foreach($lists['data'] as $key=>$val)
{
?>
<tr data-id="<?php echo $val['id']; ?>">
<td style="text-align:left;"><?php echo $val['id']; ?></td>
<td style="text-align:left;">
<div class="mypointer" data-toggle="tooltip"
data-placement="bottom" title="<?php echo $val['uname']; ?>" style="text-align: left;"><?php echo $val['uname']; ?></div>
</td>
<td style="text-align:left;"><?php echo $val['nickname']; ?></td>
<td style="text-align:left;"><?php echo $val['acode']; ?></td>
<td style="text-align:left;"><?php echo $val['money']; ?></td>
<td style="text-align:left;">
	<?php if($val['stat']==0){ echo "正常";}else{ echo "禁用";} ?>
</td>
<td style="text-align:right;">

<?php
if( ( in_array(30400,$ruleLists) || $global==1) )
{
if($val['is_system']==0)
{
?>
    <input type="button" power="30400" value="删除" onclick="del('<?=$val['id']?>')" class="link_btn del"/>
<?php
}
}
?>
</td>
</tr>

<?php
}
?>
</table>
{include file="../application/admin/view/layout/page_tpl_new.html" /}

	  
<script>


function addAccpoint(){
	  var that =this;
	   var url="/admin/agent/addData";
	   var param={};
	   MyContentLoad(url,param);
}

function edit(id){
	   var url="/admin/agent/editData";
	   var param={
	           id:id
	   };
	   ContentLoadGo(url,param);
}


function del(id){
	   var url="/admin/agent/delData";
	   var param={
			   id:id
	   };
	   var that =this;
	   cofirmsss_tishi(1,'您确定要删除吗?',function(id){
		 
		   AjaxRequest(url,param,function(data){
			   if(data.err==0)
			   {
				   SuccessTiShi("操作成功");
				   
				   $(that).parent().parent().remove();
				   ContentLoadGo("/admin/agent/agentList");
			   }
			   else
			   {
				   ErrTiShi("操作失败");
			   }
		   });
		   
	   });
}

function myResearch(){
	 var url="/admin/agent/agentList";
	 var ser_key =$("#ser_key").val();
	 var ser_val =$("#ser_val").val()
	 var ser_stats =$("#ser_stats").val();
	 var page=$("#cpage").val();
	 var param={
		   ser_key:ser_key, 
		   ser_val:ser_val, 
		   ser_stats:ser_stats,
		   page:page
	 };
	 ContentLoadGo(url,param);
}

$(function (){
	
	 $(".research").unbind().bind("click",function(){
		   var page =$(this).attr("page");
		   $("#cpage").val(page);
		   myResearch();
	 });
	 
    $("[data-toggle='tooltip']").tooltip();
});
</script>
{/block}
   